package com.example.courseselect.web;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import javax.validation.Valid;

import com.example.courseselect.domain.Student;
import com.example.courseselect.domain.course;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;


import lombok.extern.slf4j.Slf4j;
@Slf4j
@Controller
@RequestMapping("/course")
@SessionAttributes("message")
public class coursecontroller{
	

	@PostMapping
	public String processDesing(@Valid @ModelAttribute("message") Student message1, Errors errors) {
		if (errors.hasErrors()) {
			return "message";
		}
		log.info("Processing design:"+message1);	
		return "show";		
	}
	}
	


